<template>
  <div id="centerRight2">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span>
          <icon name="align-left" class="text-icon"></icon>
        </span>
        <span class="fs-xl text mx-2" style="font-size: 16px;">汽车销售价格分布图</span>
      </div>
      <div class="d-flex ai-center flex-column body-box">
        <dv-capsule-chart class="dv-cap-chart" :config="config1" style="height: 150px;"/>
        <dv-active-ring-chart :config="config2" style="width:300px;height:250px; position: relative; top: -20px;"/>
      </div>
    </div>
  </div>
</template>

<script>
import http from '../axios/http';
export default {
  data() {
    return {
      config1: {
        data: [

        ]
      },
      config2: {
        data: [

        ],
        digitalFlopStyle: {
          fontSize: 1
        },
        radius: '60%',
        activeRadius: '60%',
      }
    }
  },
  components: { 

  },
  mounted () {
    this.get_centerRightTwo();
  },
  methods:{
    get_centerRightTwo(){
      http.get('largescreen/centerrighttwo/').then(response=>{
        this.config1 = {
          data: response.data.format_list,
          colors: ['#99CCFF', '#CC99FF', '#6699FF', '#FF66CC', '#FFFF99'],
          unit: '万元',
          showValue: true
        }
        this.config2 = {
          data: response.data.format_list,
          digitalFlopStyle: {
            fontSize: 20
          },
          radius: '60%',
          activeRadius: '65%',
          lineWidth: 30,
          color: ['#99CCFF', '#CC99FF', '#6699FF', '#FF66CC', '#FFFF99'],
        }
      }).catch(error=>{
        console.log(error)
      })
    } 
  }
}
</script>

<style lang="scss" scoped>
#centerRight2 {
  $box-height: 410px;
  $box-width: 340px;
  padding: 5px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;
  .bg-color-black {
    padding: 1px;
    height: $box-height;
    width: $box-width;
    border-radius: 10px;
  }
  .text {
    color: #c3cbde;
  }
  .body-box {
    border-radius: 10px;
    overflow: hidden;
    .dv-cap-chart {
      width: 100%;
      height: 160px;
    }
  }
}
</style>
